package com.baimawangzi.recovery.util.propertiesutil;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesUtil {

    private Properties properties;

    public PropertiesUtil(String path){
        //一个空属性列表
        properties=new Properties();
        //把jdbc.properties文件加载到流中
        InputStream inputStream = this.getClass().getResourceAsStream(path);
        try {
            //通过Properties对象加载流
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    //读取文件中的内容
    public String getProperties(String key){
        return properties.getProperty(key);
    }

}
